package com.albaba.designpattern.mediator.text_002;

/**
 * @Description: TODO
 * @Author zx
 * @Date 2025/3/3 16:55
 * @Version 1.0
 */
public class Client {

    public static void main(String[] args) {

        // 中介机构
        MediatorStructure mediator = new MediatorStructure();

        // 房主
        HouseOwner houseOwner = new HouseOwner("张三", mediator);

        // 租客
        Tenant tenant = new Tenant("李四", mediator);

        // 中介收集房主及租房者信息
        mediator.setHouseOwner(houseOwner);
        mediator.setTenant(tenant);

        // 租房人的需求
        tenant.contact("我要在天通苑附近找一个，两室一厅的房子");
        // 房主的需求
        houseOwner.contact("我要出租一个两室一厅的房子");

    }
}
